package Algorithm;

import java.io.File;

/**
 * TOOD
 *
 * @author long
 * @date 2020-07-19 15:51
 */
public class Counter2 {

    public static void main(String[] args){
         File file = new File("D:/");
         File[] files = file.listFiles();

         readfile(files);
    }

    private static void readfile(File[] files) {
        if (files==null){
            return;
        }
        for (File f:files){
            if (f.isFile()){
                System.out.println(f.getName());
            }else if (f.isDirectory()){
                System.out.println(f.getName());
                readfile(f.listFiles());
            }
        }
    }
}
